<?php
session_cache_expire(999999999);
if(!isset($_SESSION)) 
	{ 
		session_start(); 
	}
include '../operations/connection.php';

if ($_REQUEST['newlang'] == "EN") {
	include "../value/value_en.php";
} else if($_REQUEST['newlang'] == "VN") {
	include "../value/value_vn.php";
}
else {
	include "../value/value_kr.php";
}

if(!isset($_SESSION['user']))
	{
		header( 'Location: login.php' );
	}
	else 
	{		
		$username = $_SESSION['fullname'];
		$id_employee = $_SESSION['IDEmployee'];
	}

$loadboardhome = mysql_query("select e.UserName,e.IDEmployee, e.FullName,b.* from employee e, board b
					where e.IDEmployee = b.IDEmployee and b.Status = 1 order by b.CreatedDate desc");

$selectinforemp = mysql_query("SELECT UserName,FullName,Phone,DATE_FORMAT(Birthday,'%Y-%m-%d') as Birthday,Address,Email FROM employee WHERE IDEmployee ='$id_employee'");
$resultempl = mysql_fetch_assoc($selectinforemp);
$fullnamemp = $resultempl[FullName];
$phone = $resultempl[Phone];
$birthday = $resultempl[Birthday];
$address = $resultempl[Address];
$email = $resultempl[Email];
$us = $resultempl[UserName];
?>

		<div id="board-content">
			<span class="caption-board"><?php echo $l_generalnotice;?></span>
			
			<center>
				<img src="images/line1.png" width="100%" /><br /> <br /> <br /> <br />
			</center>
			<table width="100%" style="border: 1px dotted silver;">
				<tr>
					<th width="5%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_no?></th>
					<th width="55%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_title?></th>
					<th width="17%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_createdby?></th>
					<th width="15%"
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $l_created_date?></th>
					<th width="8%" style="border-bottom: 1px dotted silver;"><?php echo $l_views?></th>
				</tr>
 
			 <?php $i=0;
					while ($row=mysql_fetch_array($loadboardhome)){
						$i++;
						$idboard = $row[ID];?>
				<tr>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $i?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver; padding-left: 5px;">
						<a href="#" onclick="processPreviewNotice('<?=$idboard?>',<?=$row[View]?>,this);"><?php echo $row[Title]?>
					</a><img src="images/ico_new_group.gif" height="11px" width="19px"
						style="margin: 0px 8px" /></td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;text-align: left;"><?php echo $row[FullName]?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $row[CreatedDate]?>
					</td>
					<td
						style="border-right: 1px dotted silver; border-bottom: 1px dotted silver;"><?php echo $row[View]?>
					</td>
				</tr>
				<?php } ?>
			</table>
			<div class="login_succ">
				<div class="welcome">
					<div class="tit_welcome"><?php echo $l_welcome?> <?php echo $us;?></div>
					<ul style="padding-left: 46px">
						<li><img src="images/user.png" alt="" /><a href="#?w=350" rel="privateInformation" class="poplight"
							onclick="getviewprofile('<?=$fullnamemp?>','<?=$phone?>','<?=$email?>','<?=$address?>','<?=$birthday?>',this);"><?php echo $l_viewprofile?></a>
						</li>
						
						<li><img src="images/change_pass.png" alt="" /><a href="#?w=350" rel="changepassword" class="poplight"
							 onclick="onclickChangepass('','','',this);"><?php echo $l_changepassword?></a>
						</li>
						
						<li><img src="images/logout.png" alt="" /><a href="logout.php"><?php echo $l_logout?></a>
						</li>
						
					</ul>

					<div style="clear: both"></div>
					<div class="line_tit"></div>
					<center>
						<table class="main_page" cellspacing="20px" align="center">
							<tr>
								<td width="200"><img src="images/approval.png" alt="" /><a
									href="ApproveMain.php"><?php echo $l_e_approval?></a></td>
								<td><img src="images/project.png" alt="" />
								<a href="ProjectMain.php"><?php echo $l_project?></a>
								</td>
							</tr>
						</table>
					</center>
				</div>
			</div>
		</div>

<div id="privateInformation" class="popup_block">
	<span
		style="background: #dad6cf; color: #000000; font-weight: bold; display: block; padding: 5px 0 5px 10px;"><?php echo $privateinfor;?>
	</span>
	<form action="" method="get">
		<input type="hidden" id="idemployee" name="idemployee"
			value="<?=$id_employee?>">
		<table width="100%" style="margin: 20px 0">
			<thead>
				<tr>
					<th scope="colgroup" colspan="2"><img src="images/profile.jpg"
						alt="profile" width="80px" /> <br />
					</th>
				</tr>
			</thead>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_fullname?></td>
				<td><input id="profullname" name="profullname" type="text" value="<?=$fullnamemp?>"
					style="width: 230px; height: 22px; font-size: 13px;" /></td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_phone?></td>
				<td><input id="prophone" name="prophone" type="text" value="<?=$phone?>"
					style="width: 230px; height: 22px; font-size: 13px;" /></td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_email?></td>
				<td><input id="promail" name="promail" type="text" value="<?=$email?>"
					style="width: 230px; height: 22px; font-size: 13px;" /></td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_address?></td>
				<td><input id="proaddress" name="proaddress" type="text" value="<?=$address?>"
					style="width: 230px; height: 22px; font-size: 13px;" /></td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_birthday?></td>
				<td><span style="white-space: nowrap;"> <input class="rf-cal-inp "
						id="probirthday" name="probirthday" readonly="readonly"
						style="vertical-align: middle; width: 230px; height: 22px; font-size: 13px;"
						type="text" value="<?=$birthday?>" /> </span>
				</td>
			</tr>
		</table>
		<div align="right" style="padding: 0px 30px 20px">
			<input type="button" onclick="updateviewprofile();waiting();"
				style=" font-size: 12px; width: 100px;"
				class="btnupbg btnupload iclose" value="<?php echo $l_update?>" /> <input
				type="button" class="btnupbg btnupload iclose"
				style=" font-size: 12px; width: 100px;"
				value="<?php echo $l_cancel;?>" />
		</div>
	</form>
</div>

<div id="changepassword" class="popup_block">
	<span
		style="background: #dad6cf; color: #000000; font-weight: bold; display: block; padding: 5px 0 5px 10px;"><?php echo $l_changepassword;?>
	</span>
	<?php $checkpass = mysql_query("Select Password from employee where IDEmployee='$id_employee';");
		$vl = mysql_fetch_assoc($checkpass);?>
	<form action="" method="get">
			<input type="hidden" id="idempl" name="idempl" value="<?=$id_employee?>">
			<input type="hidden" id="hidepass" name="hidepass" value="<?=$vl[Password]?>">
		<table width="100%" style="margin: 20px 0">
			<thead>
				<tr>
					<th scope="colgroup" colspan="2"><img
						src="images/icon_member_resend_pass.gif" alt="profile"
						width="80px" /> <br />
					</th>
				</tr>
			</thead>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_oldpass?></td>
				<td><input id="oldpassword" name="oldpassword" type="password" value=""
					style="width: 215px; height: 22px; font-size: 13px; margin-right: 5px" />
				</td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_newpassword?></td>
				<td><input id="newpassword" name="newpassword" type="password" value=""
					style="width: 215px; height: 22px; font-size: 13px; margin-right: 5px" />
				</td>
			</tr>
			<tr>
				<td style="padding-left: 5px"><?php echo $l_retypepassword?></td>
				<td><input id="repassword" name="repassword" type="password" value=""
					style="width: 215px; height: 22px; font-size: 13px; margin-right: 5px" />
				</td>
			</tr>

		</table>
		<div align="right" style="padding: 0px 30px 20px">
			<input type="button" onclick="validatePassword();updatePassword();watingPass();"
				style=" font-size: 12px; width: 100px;"
				class="btnupbg btnupload iclose" value="<?php echo $l_update?>" /> 
			<input type="button" class="btnupbg btnupload iclose" onclick="resetpassword();"
				style=" font-size: 12px; width: 100px;"
				value="<?php echo $l_cancel;?>" />
		</div>
	</form>
</div>
